﻿<form action="index.php" method="post" name="addFrom" enctype="multipart/form-data" >
<table>
	<tr style="border:1px solid silver">
		<td>Tiêu đề</td>
		<td>
			<input type="text" style="width:260px;" name="title" value="<?php echo (isset($this->image->title))?$this->image->title:''; ?>" />		
		</td>
	</tr>
	<tr style="border:1px solid silver">
		<td>Tự động chỉnh kích thước</td>
		<td>
			<input type="checkbox" name="resize" value="0" onclick="if(this.checked==true){this.value=1;document.addFrom.width.disabled=false;document.addFrom.height.disabled=false;}else {this.value=0;document.addFrom.width.disabled=true;document.addFrom.height.disabled=true;}" />
		</td>
	</tr>
	<tr style="border:1px solid silver">
		<td>Chiều rộng</td>
		<td>
			<input type="text" style="width:160px;" name="width" value="500" />px
		</td>
	</tr>
	<tr style="border:1px solid silver">
		<td>Chiều cao</td>
		<td>
			<input type="text" style="width:160px;" name="height" value="500" />px		
		</td>
	</tr>
	<tr>
		<td>
			Hình ảnh
		</td>
		<td>
			<input type="file" name="image">
		</td>
	</tr>
	<tr>
		<td>
			<input type="submit" name="Submit" value="Save" />
			<input type="button" onclick="document.location.href='index.php?c=product&t=showimage&producid=<?php echo sscls_Request::getRequest('productid') ?>';" value="Close" />
		</td>
	</tr>
</table>
<input type="hidden" name="c" value="product" />
<input type="hidden" name="productid" value="<?php echo sscls_Request::getRequest('productid') ?>" />
<input type="hidden" name="t" value="processaddimage" />
<input type="hidden" name="id" value="<?php echo @(int)$this->image->id ?>" />
</form>
<script type="text/javascript">
	function checkvalid()
	{
		if(document.addFrom.name.value=='')
			alert('Vui lòng nhập tên !');
		else
			document.addFrom.submit();
	}
	
</script>
